//
// Created by Administrator on 2024/5/21.
//
extern "C"
{
#include "lualib.h"
#include "lauxlib.h"
}

#include "binding.h"
#include "luaglfw.h"
#include "luabase.h"
#include "luavulkan.h"

static const luaL_Reg libs[] = {
        {"glfw",   luaopen_glfw},
        {"vulkan", luaopen_vulkan},
        {nullptr,  nullptr}};

void lua_openLibs(lua_State *L) {
    luaL_openlibs(L);
    luaopen_baseX(L);
    const luaL_Reg *lib;
    for (lib = libs; lib->func; lib++) {
        luaL_requiref(L, lib->name, lib->func, 1);
        lua_pop(L, 1); /* remove lib */
    }
}